<!DOCTYPE html>
<html lang="es">
	<head>
    	<title>{{ titulo_pagina }}</title>
        <!-- Styles -->
        <link href="{{ path }}css/bootstrap-print.css" rel="stylesheet">
        <link href="{{ path }}css/bootstrap-overrides.css" rel="stylesheet">
		<style>
			.table {
				border:solid;
				border-width:2px;
			}
			.border-row td {
				border-style:solid;  
				border-width:1px;
			}

			.no-border-row td {
				border:none;
			}
		</style>
    </head>

<body>
{% load humanize %}

<div class="widget widget-table" align="center">
	<div align="center">
        <p><h1>{{ matricula.estudiante.configuracion.institucion }}</h1></p>
        <p><h2>Historial de pagos por estudiante</h2></p>
	</div>
    <br/>
    
    <div align="center">
		<table class="table" border="1px" width="820px" cellpadding="3px" cellspacing="0">
		  <tr class='no-border-row' align="center">
			<td width="180px" rowspan="3">
					{% if request.session.config.logo %}
						<img src="{{ path }}{{ request.session.config.logo }}" height="85px" alt="avatar">
					{% else %}
						<img src="{{ path }}img/logo.jpg" alt="avatar">
					{% endif %}
			</td>
			<td colspan="4" align="center"><strong>CENTRO DE EDUCACION ABIERTA Y A DISTANCIA</strong></td>
		  </tr>
		   <tr class='no-border-row'>
			<td colspan="4" align="center"><strong>ACUERDO DE PAGO DE MATRICULA</strong></td>
		  </tr>
		  <tr class='no-border-row'>
			<td width="180px">PERIODO: </td>
			<td width="100px">{{ matricula.periodo.nombre }}</td>
			<td width="180px">&nbsp;</td>
			<td width="180px">&nbsp;</td>
		  </tr>
		  <tr>
			<td><strong>NOMBRE:</strong></td>
			<td colspan="4" align="center">{{ matricula.estudiante.nombre }}</td>
		  </tr>
		  <tr>
			<td><strong>C.C.</strong></td>
			<td>{{ matricula.estudiante.identificacion }}</td>
			<td><strong>TEL:</strong></td>
			<td colspan="2" align="center">{{ matricula.estudiante.celular }}</td>
		  </tr>
		  <tr>
			<td><strong>E-MAIL:</strong></td>
			<td colspan="4">{{ matricula.estudiante.email }}</td>
		  </tr>
		  <tr>
			<td><strong>PROGRAMA:</strong></td>
			<td colspan="2">{{ matricula.facultad.nombre }}</td>
			<td><strong>SEM:</strong></td>
			<td>{{ matricula.semestre }}</td>
		  </tr>
		  <tr>
			<td><strong>FECHA DE INGRESO:</strong></td>
			<td colspan="4">{{ matricula.fecha }}</td>
		  </tr>
		  <tr>
			<td>&nbsp;</td>
			<td colspan="2" align="center"><strong>VALOR SEMESTRE</strong></td>
			<td align="center"><strong>DESCUENTO</strong></td>
			<td align="center"><strong>VALOR A PAGAR DE CONTADO</strong></td>
		  </tr>
		  <tr>
			<td><strong>VR. SEMESTRE</strong></td>
			<td colspan="2" align="center">$ {{ matricula.valor_credito|floatformat:0|intcomma }}</td>
			<td align="right">$ {{ matricula.valor_descuento|floatformat:0|intcomma }}</td>
			<td align="right">$ {{ valor_contado|floatformat:0|intcomma }}</td>
		  </tr>
		  <tr>
			<td><strong>SON:</strong></td>
			<td colspan="4">&nbsp;</td>
		  </tr>
		  <tr>
			<td colspan="5" align="center"><strong>PAGO FINANCIADO</strong></td>
		  </tr>
		  <tr>
			<td><strong>CUOTA INICIAL</strong></td>
			<td colspan="2" align="center">$ {{ cuota_inicial|floatformat:0|intcomma }}</td>
			<td>2 CUOTAS</td>
			<td>3 CUOTAS</td>
		  </tr>
		  <tr>
			<td><strong>FINANCIACION</strong></td>
			<td colspan="2" align="right">$ {{ vlr_financiacion|floatformat:0|intcomma }}</td>
			<td align="right">
				{% if matricula.cuotas == 2 %}
					$ {{ vlr_cuota|floatformat:0|intcomma }}
				{% endif %}
			</td>
			<td align="right">
				{% if matricula.cuotas == 3 %}
					$ {{ vlr_cuota|floatformat:0|intcomma }}
				{% endif %}
			</td>
		  </tr>
		  <tr>
			<td colspan="5">&nbsp;</td>
		  </tr>
		  <tr>
			<td align="center"><strong>FORMA DE PAGO</strong></td>
			<td colspan="2" align="center"><strong>FECHAS</strong></td>
			<td colspan="2" align="center"><strong>VALOR</strong></td>
		  </tr>
		  <tr>
		  {% for pago in pagos %}
		  <tr>
			{% if pago.cuota_id == 0 %}
				<td>CUOTA INICIAL</td>
			{% else %}
				<td>Cuota {{ pago.cuota_id }}</td>
			{% endif %}
			<td colspan="2" align="right">{{ pago.fecha|date:'d-m-Y' }}</td>
			<td colspan="2" align="right">$ {{ pago.valor|floatformat:0|intcomma }}</td>
		  </tr>
		  {% endfor %}
		  <tr>
			<td colspan="3" align="center"><strong>SALDO</strong></td>
			<td colspan="2" align="right">$ {{ valor_saldo|floatformat:0|intcomma }}</td>
		  </tr>
		  <tr>
			<td colspan="3" height="100px">&nbsp;</td>
			<td valign="top">COSTO FINANCIACION  $ </td>
			<td align="right">$ {{ matricula.intereses|floatformat:0|intcomma }}</td>
		  </tr>
		  <tr>
			<td colspan="3">FIRMA DEL ESTUDIANTE</td>
			<td colspan="2">FIRMA FUNC. CARTERA</td>
		  </tr>
		  <tr>
			<td colspan="3">Acepto.</td>
			<td colspan="2">Acepto.</td>
		  </tr>
		</table>
	</div>

    <br/>
    
</div> <!-- /. widget-table -->

</body>
</html>